Function Reference

_TS_TaskStop

Stops all instances of the Registered Task immediately.

#Include <TaskScheduler.au3>
_TS_TaskStop($oService, $vTask)

 

Parameters

$oService Task Scheduler Service object as returned by _TS_Open
$vTask Registered Task to stop. Can be the object or a string e.g. "\folder\task"

 

Return Value

Success: 1
Failure: Returns 0 and sets @error
    2301 - The Task does not exist. @extended is set to the COM error code returned by _TS_TaskGet
    2302 - Error stopping the Task. @extended is set to the COM error

 

Remarks

The function stops all instances of the task.
System account users can stop a task, users with Administrator group privileges can stop a task,
and if a user has rights to execute and read a task, then the user can stop the task.
A user can stop the task instances that are running under the same credentials as the user account.
In all other cases, the user is denied access to stop the task.

 

Related

 

Example


#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=y
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <MsgBoxConstants.au3>

MsgBox($MB_ICONINFORMATION, "Task Scheduler UDF", "Please check example script _TS_TaskRun.au3 for an example!")